
function indexesEdit(obj) {
	if(UTIL.checkButton(obj)) {
		var normalName = $("#normalName").val();
		if(!normalName) {
			UTIL.releaseButton(obj);
			alert("请填写标准名称");
		} else {
			var param = $('#indexEditForm').serialize();
			API.indexEdit(param, function(res) {
				UTIL.releaseButton(obj);
				if (res.code == '0') {
					window.location.href = "/inspection/indexes_list.htm";
				} else {
					alert(res.desc);
				}
			});
		}
	}
}

function changeIndexes() {
	var classId = $("#classId").val();
	var normalName = $("#normalName").val();
	
	if(normalName) {
		var param = {
			"classId": classId,
			"normalName": normalName
		}
		API.getEncyclopediaByIndex(param, function(res) {
			if (res.code == '0') {
				var ie = res.data.ie;
				if(ie.id) {
					$("#normalValue").val(ie.normalValue?ie.normalValue:"");
					$("#implication").html(ie.implication?ie.implication:"");
					$("#clinicalSign").html(ie.clinicalSign?ie.clinicalSign:"");
					$("#attention").html(ie.attention?ie.attention:"");
				}
			} else {
				alert(res.desc);
			}
		});
	}
}